From 150e0572c8466443dd28604f877484922fb56e1a Mon Sep 17 00:00:00 2001 From: Gleb Kozyrev Date: Thu, 12 Nov 2015 01:56:21 +0200 Subject: [PATCH] Fix #1504. Don't blow up on empty fingerprint files --- src/cargo/ops/cargo_rustc/fingerprint.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cargo/ops/cargo_rustc/fingerprint.rs b/src/cargo/ops/cargo_rustc/fingerprint.rs index 945b42f23..885d3de82 100644 --- a/src/cargo/ops/cargo_rustc/fingerprint.rs +++ b/src/cargo/ops/cargo_rustc/fingerprint.rs @@ -500,7 +500,9 @@ fn calculate_target_mtime(dep_info: &Path) -> CargoResult> { let mut f = BufReader::new(fs_try!(File::open(dep_info))); // see comments in append_current_dir for where this cwd is manifested from. let mut cwd = Vec::new(); - fs_try!(f.read_until(0, &mut cwd)); + if fs_try!(f.read_until(0, &mut cwd)) == 0 { + return Ok(None) + } let cwd = try!(util::bytes2path(&cwd[..cwd.len()-1])); let line = match f.lines().next() { Some(Ok(line)) => line, -- 2.30.2